/**
 * Created by zhuyufeng on 2015/12/30.
 */
Ext.define('watermodel', {
	extend: 'Ext.data.Model',
	fields: [ 'date', 'num']
});
var waterStore = Ext.create('Ext.data.Store', {
	model: 'watermodel',
	autoLoad: true,
	pageSize: 4,
	proxy: {
		type: 'ajax',
		url : './json/water',
		reader: {
			type: 'json',
			root: 'rows',
			totalProperty: 'total'
		}
	}
});
var waterhistroy = Ext.create('Ext.grid.Panel', {
	store: waterStore,
	columnWidth:.8,
	region:'east',
	split:true,
	border:true,
	collapsible:true,
	width:400,
	minSize:400,
	maxSize:600,
	title: '送水记录',
	columns: [
		{
			text: '日期',
			width: 100,
			dataIndex: 'date'
		},
		{
			text: '水桶数',
			width: 150,
			dataIndex: 'num'
		}
	],
	dockedItems:[{
		xtype:'pagingtoolbar',
		store:waterStore,
		dock:'bottom',
		displayInfo:true,
		displayMsg:'第{0}条到第{1}条,一共{2}条',
		emptyMsg:'没有记录'
	}]
});
